#include <iostream>
using std::cout;
using std::endl;
//对于基类成员函数的隐藏
class Base{
public:
    void print(){
        cout << "Base::print()" << endl;
    }
};
//函数的名称相同即可发生隐藏
//至于函数的参数列表、返回值类型均无要求
class Derived : public Base{
public:
    int print(int number){
        cout << "Derived::print" << number << endl;
        return number;
    }
};
void test(){
    Derived d;
    //d.print();error
    d.print(10);
    d.Base::print();//不推荐
}

int main()
{
    test();
    return 0;
}

